package com.it.sun.yuebike.base.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.it.sun.yuebike.framework.model.vo.AttachmentVO;
import com.it.sun.yuebike.framework.mybatis.AttachmentsTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author sunmannian
 * @since 2021-06-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("yue_bike_invitation")
@ApiModel(value = "InvitationEntity对象", description = "")
public class InvitationEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键信息")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "骑行的内容信息")
    @TableField("content")
    private String content;

    @ApiModelProperty(value = "相关照片信息")
    @TableField(value = "pictures", typeHandler = AttachmentsTypeHandler.class)
    private List<AttachmentVO> pictures;

    @ApiModelProperty(value = "联系电话")
    @TableField("contract_phone")
    private String contractPhone;

    @ApiModelProperty(value = "骑行线路")
    @TableField("line")
    private String line;

    @TableField("starting_point")
    @ApiModelProperty("起点")
    private String startingPoint;

    @ApiModelProperty(value = "终点")
    @TableField("destination")
    private String destination;

    @ApiModelProperty(value = "发布人")
    @TableField("publisher")
    private String publisher;

    @ApiModelProperty(value = "出发时间")
    @TableField("start_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


}
